package yc.gg.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import yc.gg.service.FollowService;
import yc.gg.utils.Result;

/**
 * \* User: Fuyue
 * \* Date: 2025/6/3
 * \* Description:
 * \
 */
@RestController
@RequestMapping("/api/follow")
public class FollowController {
    @Autowired
    private FollowService followService;
    @PostMapping("/user/{id}/{isFollow}")
    public Result followUser(@PathVariable("id") String followUserId, @PathVariable("isFollow") Boolean isFollow) {
        return followService.followUser(followUserId, isFollow);
    }

    /**
     * 查询是否关注
     */
    @GetMapping("/user/{id}")
    public Result isFollowUser(@PathVariable("id") String followUserId) {
        return followService.isFollowUser(followUserId);
    }

    /**
     * 共同关注
     */
    @GetMapping("/user/common/{id}")
    public Result followCommonsUser(@PathVariable("id") String id) {
        return followService.followCommonUser(id);
    }

    /**
     * 查询我的粉丝列表
     */
    @GetMapping("/myFans")
    public Result myFans() {
        return followService.myFans();
    }

    /**
     * 是否互相关注
     */
    @GetMapping("/isOther")
    public Result isOtherFollow(String id) {
        return followService.isOtherFollow(id);
    }

    @GetMapping("other")
    public Result other() {
        return followService.other();
    }

    @GetMapping("/fansMsg")
    public Result myfansMsg() {
        return followService.myfansMsg();
    }
}